package org.shj.flink.demo;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.shj.flink.dto.SourceStaffDTO;
import org.shj.flink.sink.MyCustomizeSink;
import org.shj.flink.source.MyCustomizeSource;
import org.shj.flink.transform.MyCustomizeTransform;

/**
 * 本例用于演示
 * @author Shen Huang Jian
 * @date 2020-08-05 17:13
 */
public class CustomizeSourceSinkDemo {

    public static void main(String[] args) throws Exception{
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStreamSource<SourceStaffDTO> ds = env.addSource(new MyCustomizeSource());

        ds.print();

        ds.map(new MyCustomizeTransform()).addSink(new MyCustomizeSink());

        env.execute("Test Customer Hua Ping");
    }
}
